home *** CD-ROM | disk | FTP | other *** search
- /******************************************************
- * BUtilities.c
- *
- * General utilities for use with THINK C with objects.
- * © copyright 1991, KSS Scientific Consultants
- * © copyright 1989, Symantecs Corporation. Some parts
- * of the code used in this section were derived from their
- * programs.
- *
- *******************************************************/
-
- #include <CApplication.h>
- #include "BBitMapDoc.h"
- #include "BDisplayOutput.h"
- #include "BGetTCLInfo.h"
- #include "BUtilities.h"
- #include <stdio.h>
- #include <string.h>
-
- #define DLOGinfo 601 // Resource ID for DLOG template
-
- extern CApplication *gApplication;
-
- /***********************************************************************
- * GetInfo()
- *
- * Get data input from the user.
- *
- **********************************************************************/
-
- void GetInfo(char *promptPtr, char *returnPtr)
- {
- BGetTCLInfo *theGetInfo;
-
- TRY
- {
- theGetInfo = new BGetTCLInfo;
- theGetInfo->IBGetTCLInfo(DLOGinfo, gApplication);
- theGetInfo->GetInfo(promptPtr, returnPtr);
- }
- CATCH
- {
- theGetInfo->Dispose();
- }
- ENDTRY;
- theGetInfo->Dispose();
- }
-
- /************************************************************
- * DumpData()
- *
- * Dump the results to an output window.
- *
- ************************************************************/
-
- void DumpData(Handle theData)
- {
- BDisplayOutput *theOutput;
-
- theOutput = new BDisplayOutput;
- theOutput->IBDisplayOutput(gApplication, TRUE);
- theOutput->DisplayRun(theData);
- theOutput->Dispose();
- }
-
- /***************************************************************
- * DumpBitMap()
- *
- * Dump a bitmap to an output window.
- *
- **************************************************************/
-
- void DumpBitMap(BitMap *theBitMap)
- {
- BBitMapDoc *theBitMapDoc;
-
- TRY
- {
- theBitMapDoc = new BBitMapDoc;
- theBitMapDoc->IBBitMapDoc(gApplication, TRUE);
- theBitMapDoc->OutputMap(theBitMap);
- }
- CATCH
- {
- theBitMapDoc->Dispose();
- }
- ENDTRY;
- theBitMapDoc->Dispose();
- }
-